import request from '@/utils/request'
//文章分类列表查询
export const articleCategoryListService = ()=>{
  return request.get('/category')
}
//新增分类
export const articleCategoryAddService = (data)=>{
  return request.post('/category',data)
}
//更新分类
export const articleCategoryUpdateService = (data)=>{
  return request.put('/category',data)
}
//删除分类
export const articleCategoryDeleteService = (id)=>{
  return request.delete(`/category`,{
    params:{id}
  })
  //return request.delete(`/category/?id=${id}`)
}
//---------文章管理接口--------------
//新增文章
export const articleAddService = (data)=>{
  return request.post('/article',data)
}
//分页查询
export const articlePageService = (data)=>{
  return request.get('/article',{
    params:data
  })
}
//获取文章详情
export const articleDetailService = (id)=>{
  return request.get(`/article/detail/${id}`)
}
//更新文章
export const articleUpdateService = (data)=>{
  return request.put('/article',data)
}
//删除文章
export const articleDeleteService = (id)=>{
  return request.delete(`/article`,
    {
      params:{id}}
    )
}